-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix pricing modal being cut off and unscrollabel on low resolution screens or when zoomed in #8848
Conversation
…licts with overflow-y: auto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This PR fixes a scrolling issue in the pricing modal by adjusting how content centering is handled, ensuring proper scrollability on low-resolution screens.
- Moved
justify-content: center
fromStyledContent
to Modal component in/packages/twenty-front/src/modules/auth/components/AuthModal.tsx
- Added
.justify-center
class toStyledMainContainer
in/packages/twenty-front/src/modules/ui/layout/page/components/DefaultLayout.tsx
for consistent centering - Resolved conflict between
justify-content: center
andoverflow-y: auto
that was causing content to be cut off - Fixed modal scrolling behavior while preserving centered alignment for non-overflowing content
2 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile
flex: 0 1 100%; | ||
overflow: hidden; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: flex: 0 1 100% with overflow: hidden might still cause content clipping in some edge cases. Consider using flex: 1 1 auto instead
Pushed a change. What do you think of this solution @khuddite? Do you see any bug/downside with it? |
@@ -29,7 +29,8 @@ const StyledModalDiv = styled(motion.div)<{ | |||
if (isMobile) return `0`; | |||
return theme.border.radius.md; | |||
}}; | |||
overflow: hidden; | |||
overflow-x: hidden; | |||
overflow-y: auto; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if there is a use case for this right now in the app, but here is what I am thinking.
When the modal has header, content, and footer, previously only content was scrollable meaning the header and footer will be sticky above/below the content. But now, the entire modal is scrollable, meaning the header or footer will be invisible at some point.
I am not sure if we are okay with following that path here. @FelixMalfait
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe that diminishes the purpose of the header/footer? IDK
ee555f2
to
7df2ef5
Compare
Thanks @khuddite for your contribution! |
Fixes: #7999
Summary
I am not 100% sure why it's happening, but it seems
justify-content: center
conflicts withoverflow-y: auto
and that's why the modal content becomes unscrollable and cut off.Solution
To preserve the styling that centers the content inside the modal even when the content height is less than the modal, I moved
justify-content: center
from the content to the modal container. When the content overflows the modal, it seemsjustify-content: center
does nothing, though.Screen Recording
CleanShot.2024-12-03.at.09.41.00.mp4